import myaxios from '../utils/myaxios.js'

//获取所有栏目
export const getArticle = (params)=>{
    return myaxios({
        url:'/post',
        params
    })
}

export const getArticleDetail = (id)=>{
    return myaxios({
        url:`/post/${id}`,
    })
}
// 点赞
export const likeArticle = (id)=>{
    return myaxios({
        url:`/post_like/${id}`,
    })
}

// 收藏
export const Stars = (id) => {
    return myaxios({
        url: `/post_star/${id}`
    })
}
// 我的收藏
export const myStars = () => {
    return myaxios({
        url: 'user_star'
    })
}
// 评论
export const comments = (id,params) => {
    return myaxios({
        url: `/post_comment/${id}`,
        params
    })
}
// 评论
export const Sendcomments = (id,data) => {
    return myaxios({
        method: 'post',
        url: `/post_comment/${id}`,
        data
    })
}

// 评论
export const searchArticle = (params) => {
    return myaxios({
        url: '/post_search',
        params
    })
}